<%-- 
    Document   : personal.jsp
    Created on : Apr 11, 2012, 5:00:54 AM
    Author     : Mr. Hung
--%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="business.Account"%>
<%@page import="business.Account"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" media="all" />
        <link href="style.css" rel="stylesheet" type="text/css" />

        <title>${account.username}</title>
    </head>
    <body>
        <c:import url="/header.jsp"/>
        <c:import url="/leftbar.jsp"/>

        <div id="wrapper">


            <div id="content_wrapper"><span class="top"></span><span class="bottom"></span>
                <div id="content">
                    <div class="welcome_stt_box"> 
                        <h2>Personal</h2>
                    </div>
                    <div class="avatar_box" >
                        <table cellpadding="5">
                            <tr>
                                <td width="150" rowspan="5"> 
                                    <img src="${account.avatar}" height="135" width="135">
                                </td>
                                <td align="right"><label>Username:</label></td>
                                <td width="10"></td>
                                <td>${account.username}</td>
                            </tr>
                            <tr>
                                <td align="right"><label>Email Address:</label></td>
                                <td width="10"></td>
                                <td>${account.emailAddress}</td>
                            </tr>
                            <tr>
                                <%-- display birthday --%>
                                <% 
                                    Account accTmp = (Account) request.getAttribute("account");
                                    Date date = accTmp.getBirthday();
                                    SimpleDateFormat formater = new SimpleDateFormat("dd/MM/yyyy");
                                    String _birthday = formater.format(date);
                                    request.setAttribute("_birthday", _birthday);
                                %>
                                <td align="right"><label>Birthday:</label></td>
                                <td width="10"></td>
                                <td>${_birthday}</td>
                            </tr>
                            <tr>
                                <td align="right"><label>Gender:</label></td>
                                <td width="10"></td>
                                <td>
                                    <c:choose>
                                        <c:when test="${account.gender == 'male'}">
                                            Male
                                        </c:when>
                                        <c:when test="${account.gender == 'female'}">
                                            Female
                                        </c:when>
                                    </c:choose>
                                </td>
                            </tr>
                            <tr>
                                <td align="right"><label>Friend Gender:</label></td>
                                <td width="10"></td>
                                <td>
                                    <c:choose>
                                        <c:when test="${account.interestGender == 'male'}">
                                            Male
                                        </c:when>
                                        <c:when test="${account.interestGender == 'female'}">
                                            Female
                                        </c:when>
                                        <c:when test="${account.interestGender == 'both'}">
                                            Both
                                        </c:when>
                                    </c:choose>
                                </td>
                            </tr>
                        </table>
                    </div>

                    <div class="personal_box">
                        <h3>Hobbies</h3></td>
                        <table>
                            <c:forEach var="hobby" items="${account.hobbies}">
                                <td width="90" align="center" >
                                    <c:if test="${hobby == 'music'}">
                                        <img src="images/music.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${hobby == 'movie'}">
                                        <img src="images/movie.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${hobby == 'book'}">
                                        <img src="images/book.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${hobby == 'sport'}">
                                        <img src="images/sport.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${hobby == 'game'}">
                                        <img src="images/games.png" height="50" width="50">
                                    </c:if>
                                </td>
                            </c:forEach>
                        </table>
                        <table>
                            <c:forEach var="hobby" items="${account.hobbies}">
                                <td width="90" align="center">
                                    <c:choose>
                                        <c:when test="${hobby == 'music'}">
                                            <label>Music</label>
                                        </c:when>
                                        <c:when test="${hobby == 'movie'}">
                                            <label>Movie</label>
                                        </c:when>
                                        <c:when test="${hobby == 'book'}">
                                            <label>Book</label>
                                        </c:when>
                                        <c:when test="${hobby == 'game'}">
                                            <label>Games</label>
                                        </c:when>
                                        <c:when test="${hobby == 'sport'}">
                                            <label>Sport</label>
                                        </c:when>
                                    </c:choose>
                                </td>
                            </c:forEach>
                        </table>
                    </div>

                    <div class="personal_box">
                        <h3>Dislikes</h3>
                        <table>
                            <c:forEach var="dislike" items="${account.dislikes}">
                                <td width="90" align="center" >
                                    <c:if test="${dislike == 'music'}">
                                        <img src="images/music.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${dislike == 'movie'}">
                                        <img src="images/movie.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${dislike == 'book'}">
                                        <img src="images/book.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${dislike == 'sport'}">
                                        <img src="images/sport.png" height="50" width="50">
                                    </c:if>
                                    <c:if test="${dislike == 'game'}">
                                        <img src="images/games.png" height="50" width="50">
                                    </c:if>
                                </td>
                            </c:forEach>
                        </table>
                        <table>
                            <c:forEach var="dislike" items="${account.dislikes}">
                                <td width="90" align="center">
                                    <c:choose>
                                        <c:when test="${dislike == 'music'}">
                                            <label>Music</label>
                                        </c:when>
                                        <c:when test="${dislike == 'movie'}">
                                            <label>Movie</label>
                                        </c:when>
                                        <c:when test="${dislike == 'book'}">
                                            <label>Book</label>
                                        </c:when>
                                        <c:when test="${dislike == 'game'}">
                                            <label>Games</label>
                                        </c:when>
                                        <c:when test="${dislike == 'sport'}">
                                            <label>Sport</label>
                                        </c:when>
                                    </c:choose>
                                </td>
                            </c:forEach>
                        </table>
                    </div>
                    <div class="settings_box">
                        <h3>Work and Education</h3>
                        <table>
                            <tr>
                                <td width="60"></td>
                                <td align="right" valign="top"><label>School:</label></td>
                                <td width="20"></td>
                                <td>${account.career.school}</td>
                            </tr>
                            <tr height="4">
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td width="60"></td>
                                <td align="right" valign="top"><label>Job:</label></td>
                                <td width="20"></td>
                                <td>${account.career.job}</td>
                            </tr>
                        </table>
                    </div>

                    <div class="settings_box">
                        <h3>Living</h3>
                        <table >
                            <tr>
                                <td width="30"></td>
                                <td align="right" valign="top"><label>Address:</label></td>
                                <td width="20"></td>
                                <td>${account.location.address}</td>
                            </tr>
                            <tr height="4">
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td width="30"></td>
                                <td align="right" valign="top"><label>Home town:</label></td>
                                <td width="20"></td>
                                <td>${account.location.hometown}</td>
                            </tr>
                            <tr height="4">
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td width="30"></td>
                                <td align="right" valign="top"><label>Country:</label></td>
                                <td width="20"></td>
                                <td>Vietnam</td>
                            </tr>

                        </table>
                    </div>

                </div> <!-- end of content -->

                <%-- side bar --%>
                <c:import url="/sidebar.jsp"/>

                <div class="cleaner"></div>                
            </div> <!-- end of wrapper -->
        </div>
        <c:import url="/footer.jsp"/>
    </body>
</html>
